package com.mybed.crm.result;

import lombok.Data;

import java.io.Serializable;

/**
 * 后端统一返回结果
 * @param <T>
 */
@Data
public class LoginResult<T> implements Serializable {
    private String msg=""; //错误信息
    private Integer code; //编码：1成功，0和其它数字为失败
    private String token;


    public static <T> LoginResult<T> success() {
        LoginResult<T> result = new LoginResult<T>();
        result.code = 200;
        result.msg="操作成功";
        return result;
    }
    public static <T> LoginResult<T> Loginsuccess() {
        LoginResult<T> result = new LoginResult<T>();
        result.code = 200;
        result.msg="操作成功";
        return result;
    }





    public static <T> LoginResult<T> error(String msg) {
        LoginResult result = new LoginResult();
        result.msg = msg;
        result.code = 0;
        return result;
    }

}
